public class CPU extends Component implements hasCore
{
    private final int coreNum;
    protected CPU(String Name, String brand, int price, int coreNum)
    {
        super(Name, brand, price);
        this.coreNum = coreNum;
    }

    @Override
    public String work()
    {
        return "CPU work";
    }

    @Override
    public int getCoreNum()
    {
        return coreNum;
    }

    @Override
    public String getInfo()
    {
        return "名称：" + this.getName() + " 品牌：" + this.getBrand()
                + " 核心数：" + this.getCoreNum() + " 价格：" + this.getPrice();
    }
}
